<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>并发症</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <style>
        ul li,
        ul li div div select,
        ul li div div input {
            font-size: 14px !important;
            ;
        }

        .aui-list-item-label {
            width: 220px !important;
            text-align: center;
        }

        .aui-list-item-input-small {
            width: 140px !important;
            position: relative;
        }

        input::-webkit-input-placeholder {
            /*Webkit browsers*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        input:-moz-placeholder {
            /*Mozilla Firefox 4 to 8*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        input::moz-placeholder {
            /*Mozilla Firefox 19+*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        input:-ms-input-placeholder {
            /*Internet Explorer 10+*/
            color: rgb(241, 11, 11);
            font-size: 16px;
        }

        .aui-list-item-input-small>input {
            width: 90px;
        }

        .aui-list-item-input-small>span {
            position: absolute;
            display: inline-block;
            height: 30px;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
        }

        .aui-list-item-label-width {
            width: 530px !important;
        }

        .aui-list-item-input>label {
            margin-left: 10px;
        }

        .aui-radio {
            margin-right: 10px;
        }

        .aui-radio,
        .aui-checkbox {
            width: 25px !important;
            height: 25px !important;
            margin-right: 5px;
        }

        .textarea-container {
            width: 100%;
            margin: 0 auto;
        }

        .textarea-container>div:nth-child(1) {
            text-align: center;
            font-size: 17px;
        }

        .textarea-container>div:nth-child(2) {
            padding: 10px;
        }

        .textarea-wrapper {
            min-height: 100px;
            border: 1px solid rgba(0, 0, 0, 0.3);
            width: 97%;
            margin: 20px auto 5px auto;
            border-radius: 5px;
        }

        .submit-btn-bottom {
            font-size: 16px;
            margin: 30px auto;
            text-align: center;
        }

        .submit-btn-bottom>button {
            border: none;
            outline: none;
            background-color: #0064B0;
            height: 50px;
            width: 150px;
            color: #fff;
        }
    </style>
</head>
<br>
<br>
<br>

<body>
    <main id="app">
        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-form-list">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            并发症
                        </div>
                        <div class="aui-list-item-input">
                            <select id="crDiseaseType">
                                <option value="">请选择</option>
                                <option value="减压病">减压病</option>
                                <option value="脑型氧中毒">脑型氧中毒</option>
                                <option value="眼型氧中毒">眼型氧中毒</option>
                                <option value="肺型氧中毒">肺型氧中毒</option>
                                <option value="鼻窦气压伤">鼻窦气压伤</option>
                                <option value="中耳气压伤">中耳气压伤</option>
                            </select>
                        </div>
                    </div>
                </li>
            </ul>
            <div class="textarea-container">
                <div>描述</div>
                <div contenteditable="true" class="textarea-wrapper" id="crDescribe">
                </div>
            </div>
        </div>
        <div>
            <div class="submit-btn-bottom">
                <button id="Preservatio" onclick="insertHoComplicationRecord()">保存</button>
                <!-- <button id="Preservatio" onclick="ceshishi()">测试</button> -->
            </div>
        </div>
    </main>
</body>

</html>

<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
     /**
     * 添加并发症
     */
     function insertHoComplicationRecord() {
        //定义toast提示框
        var toast = new auiToast();
            //定义toast提示框
            var toast = new auiToast();
            //获取所属医院IP地址
            var Url_IP = ToConfigure_IP("Gorgeous");
            //获取参数
            var JsonStr = GetParameters();
            console.log(JsonStr);
            /**
             * 验证参数是否为空
             */
            if (JsonStr) {
                /**
                 * 请求控制器
                 */
                $.ajax({
                    url: Url_IP + '/businessmanagement/hocomplicationrecord/insertHoComplicationRecord',
                    type: 'post',
                    contentType: "application/json",
                    dataType: "json",
                    data: JsonStr,
                    success: function (result) {
                        /**
                         * 验证是否成功
                         */
                        if (result.success == true) {
                            /**
                             *  提示成功信息
                             */
                             toast.success({
                                title: "提交成功",
                                duration: 1000
                            });
                            JumpPage()
                        } else {
                            /**
                             *  提示错误信息
                             */
                            toast.fail({
                                title: "提交失败",
                                duration: 2000
                            });
                        }
                    },
                    error: function (result) {
                        /**
                         *  提示错误信息
                         */
                        toast.fail({
                            title: "提交失败",
                            duration: 2000
                        });
                    }
                });
            }
    }

    //跳转页面
    function JumpPage() {
        var dialog = new auiDialog();
        dialog.alert({
            title: "提示",
            msg: '操作成功，是否跳转舱内患者列表',
            buttons: ['取消', '确定']
        }, function (ret) {
            if (ret.buttonIndex === 1) {

            } else if (ret.buttonIndex === 2) {

                api.historyBack({}, function (ret, err) {
                    if (!ret.status) {
                        api.closeWin();
                    }
                });

                api.sendEvent({
                    name: 'On_Site_Inspection',
                    extra: {
                        state: 'no'
                    }
                });
            }
        })
    }

/**
 * 获取参数
 */
function GetParameters() {
    /**
     * 实例化
     * @type {Object}
     */
    var jsParms = new Object();
    /**
     *
     */
    if(api.pageParam.cfpTrId>0){
        jsParms.crTrId =api.pageParam.cfpTrId;
    }else{
        jsParms.crTrId =api.pageParam.F_ID;
    }
    if(api.pageParam.cfpCfId>0){
    /**
     *
     */
     jsParms.crCfId = api.pageParam.cfpCfId;
    }else{
        jsParms.crCfId = 1;
    }
    /**
     *
     */
    jsParms.crDescribe = $("#crDescribe").text();
    /**
     *
     */
    jsParms.crDiseaseType = $("#crDiseaseType").val();

    /**
     * 杩斿洖JSON绫诲瀷鏁版嵁
     */
    return JSON.stringify(jsParms);

}

</script>